package com.youkeyi.ddy.cloud.common.api.application.system.tag;

import com.youkeyi.ddy.cloud.common.api.application.system.tag.dto.SystemTagListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.tag.dto.SystemTagQueryBindListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.tag.param.*;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 系统标签
 *
 * @Tagor liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【SYSTEM】tag management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-SYSTEM", fallback = SystemTagCloudServiceFallback.class)
@RequestMapping("/system/tag")
public interface SystemTagCloudService {

    // 查询标签列表
    @ApiOperation(value = "Query System Tag List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.tag.SystemTagCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemTagListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Tag List", dataType = "SystemTagListCloudParam", dataTypeClass = SystemTagListCloudParam.class),
    })
    @GetMapping
    public abstract SystemTagListCloudDto list(SystemTagListCloudParam param);

    // 创建标签
    @ApiOperation(value = "Create System Tag", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.tag.SystemTagCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create System Tag", dataType = "SystemTagCreateCloudParam", dataTypeClass = SystemTagCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody SystemTagCreateCloudParam param);


    // 编辑标签
    @ApiOperation(value = "Update System Tag", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.tag.SystemTagCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update System Tag", dataType = "SystemTagUpdateCloudParam", dataTypeClass = SystemTagUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody SystemTagUpdateCloudParam param);


    // 删除标签
    @ApiOperation(value = "Delete System Tag", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.tag.SystemTagCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete System Tag", dataType = "SystemTagDeleteCloudParam", dataTypeClass = SystemTagDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(SystemTagDeleteCloudParam param);






    // 绑定标签
    @ApiOperation(value = "bind System Tag", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.tag.SystemTagCloudService.bind")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Bind System Tag", dataType = "SystemTagBindCloudParam", dataTypeClass = SystemTagBindCloudParam.class),
    })
    @PostMapping("/bind")
    public abstract ResponseContent bind(@RequestBody SystemTagBindCloudParam param);

    // 解绑标签
    @ApiOperation(value = "unbind System Tag", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.tag.SystemTagCloudService.unbind")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Unbind System Tag", dataType = "SystemTagUnbindCloudParam", dataTypeClass = SystemTagUnbindCloudParam.class),
    })
    @PostMapping("/unbind")
    public abstract ResponseContent unbind(@RequestBody SystemTagUnbindCloudParam param);

    // 查询标签绑定关系
    @ApiOperation(value = "Query System Tag Bing", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.tag.SystemTagCloudService.queryBind")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemTagQueryBindListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Tag Bing", dataType = "SystemTagQueryBindCloudParam", dataTypeClass = SystemTagQueryBindCloudParam.class),
    })
    @GetMapping("/query/bind")
    public abstract SystemTagQueryBindListCloudDto queryBind(SystemTagQueryBindCloudParam param);

}
